<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>Fly Prod</title>
        <meta name="keywords" content="" />
        <meta name="description" content="" />
        <link rel="stylesheet" type="text/css" href="default.css" />
        <script type="text/javascript" src="scripts.js"></script>
    </head>
    <body>
        <div id="upbg"></div>
        <div id="outer">
            <?php
            include 'header.php';
            include 'login.php';
            include 'menu.php';
            ?>
            <div id="content">
                <div class="sousTitreInfoInscription">Nous contacter</div>
                <p>
                    <?php
                    if (!isset($_POST['sujet']) && !isset($_POST['contenu']) && !isset($_POST['email'])) {
                        echo "Pour nous contacter, remplissez le formulaire suivant";
                    } else {
                        if ($_POST['sujet'] == "" || $_POST['contenu'] == "") {
                            echo "Veuillez remplir tout les champs";
                        } else {
                            $sujet = $_POST['sujet'];
                            $contenu = $_POST['contenu'];
                            $mail = $_POST['email'];
                            $headers = 'From: "UtilisateurSite"<' . $mail . '>' . "\n";
                            $headers .='Reply-To: ' . $mail . "\n";
                            $headers .='Content-Type: text/plain; charset="utf-8"' . "\n";
                            $headers .='Content-Transfer-Encoding: 8bit';
                            if (mail('florian.minin@gmail.com', $sujet, $contenu, $headers)) {
                                echo "Message envoyé";
                            } else {
                                echo "Le message n'a pas pu être envoyé";
                            }
                        }
                    }
                    ?>
                </p>
                <div id="blockFormContact">
                
                <form method='post' action=''>
                    <label for="sujet">Sujet</label><input type="text" id="sujet" name="sujet" size="40"></input><br/>
                    <label for="email">Adresse mail</label><input type="text" id="email" name="email" size="40"></input><br/>
                    <label for="contenu">Contenu</label><textarea rows="6" cols="40" name="contenu" id="contenu"/></textarea><br/>
                    <label></label><input type="submit" value="Envoyer" name="bouton" onclick="verifFormulaire()"></input>
                </form>
                </div>
            </div>
                <?php
                    include 'footer.php';
                ?>
        </div>
    </body>
</html>